<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/commons/jsp/taglibs.jsp"%>
<%@taglib prefix="frame" uri="http://www.framework.com/taglib"%>
<th align='right' width='10%'>部门类型</th>
<td >
	<select name="type"  id="typeId"
	  style="width:80px;"  data-options="panelHeight:100">;
<%--		<option value='3'>部门</option>--%>
		
		<c:if test="${dept.type == -1}">
			<option value='3' <c:if test="${param.type == 3}">selected="selected"</c:if>>部门</option>
				<!-- <option value='0' <c:if test="${param.type == 0}">selected="selected"</c:if>>省</option> -->
				
		</c:if>
		<c:if test="${dept.type == 0}">
			<option value='3' <c:if test="${param.type == 3}">selected="selected"</c:if>>部门</option>
				<option value='1' <c:if test="${param.type == 1}">selected="selected"</c:if>>市</option>
				
		</c:if>
		<c:if test="${dept.type == 1}">
			<option value='3' <c:if test="${param.type == 3}">selected="selected"</c:if>>部门</option>
				<option value='2' <c:if test="${param.type == 2}">selected="selected"</c:if>>县区</option>
		</c:if>
		<c:if test="${dept.type == 2}">
				<option value='3' <c:if test="${param.type == 3}">selected="selected"</c:if>>部门</option>
		</c:if>
		<c:if test="${dept.type == 3}">
				<option value='3' <c:if test="${param.type == 3}">selected="selected"</c:if>>部门</option>
		</c:if>
	</select> 
</td>
<script type="text/javascript">
<!--
$(document).ready(function () {
	<c:choose>
		<c:when test = "${not empty param.type}">
			var type = ${param.type};
			if(type == 0 || type == 1 || type == 2){
				var show ='<th align="right" width="10%" id="deptShow">部门编码</th>';
				show += '<td id="depteInput"><input name="deptCode" class="easyui-validatebox" value="${param.deptCode}" size="30" data-options="required:true,validType:[\'charAndDigit\',\'unique[\\\'${ctx}\\\',\\\'T_SYS_DEPT_INFO\\\',\\\'DEPT_CODE\\\',\\\'${param.deptId }\\\']\']" maxlength="10"/></td>';
				$('#deptType').append(show);
				$.parser.parse("#deptType");
			}
		</c:when>
		
	</c:choose>
	
	$("#typeId").combobox({
		onChange: function (n,o) {
			if(n == 0 || n == 1 || n == 2){
				$('#deptShow').remove();
				$('#depteInput').remove();
				$.parser.parse("#deptType");
				var show ='<th align="right" width="10%" id="deptShow">部门编码</th>';
				show += '<td id="depteInput"><input name="deptCode" class="easyui-validatebox" size="30" value="${param.deptCode}" data-options="required:true,validType:[\'charAndDigit\',\'unique[\\\'${ctx}\\\',\\\'T_SYS_DEPT_INFO\\\',\\\'DEPT_CODE\\\',\\\'${param.deptId }\\\']\']" maxlength="10"/></td>';
				$('#deptType').append(show);
				$.parser.parse("#deptType");
			}else{
				$('#deptShow').remove();
				$('#depteInput').remove();
				$.parser.parse("#deptType");
			}
		}
	});
});
//-->
</script>
